﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace Sinacor.Infra.UI.Controls.SmartClient
{
    public class FieldCollection : KeyedCollection<string, Field>
    {
        /// <summary>
        /// Construtor que inicializa Column
        /// </summary>
        /// <param name="dataGrid">Coluna para o qual a coleção pertence</param>
        internal FieldCollection(Column column)
            : base()
        {
            _column = column;
        }

        private Column _column;
        /// <summary>
        /// Coluna para o qual a coleção pertence
        /// </summary>
        internal Column Column
        {
            get { return _column; }
        }

        protected override string GetKeyForItem(Field item)
        {
            return item.Name;
        }
    }
}
